package com.doraz.orb.structs;

import java.util.ArrayList;

import org.w3c.dom.Element;

public class Group implements OrbObject {
	
	private String searchId = null;
	private String path = null;
	private String title = null;
	private int count = 0;
	
	private ArrayList<OrbObject> items = null;	
	
	public Group(String path, String title) {
		this.path = path;
		this.title = title;
	}
	
	public Group(String searchId, String path, String title) {
		this.searchId = searchId;
		this.path = path;
		this.title = title;
	}
	
	public Group(String searchId, String path, String title, int count) {
		this.searchId = searchId;
		this.path = path;
		this.title = title;
		this.count = count;
	}

	/**
	 * @return the path
	 */
	public String getPath() {
		return path;
	}
	
	/**
	 * @param path the path to set
	 */
	public void setPath(String path) {
		this.path = path;
	}
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the items
	 */
	public ArrayList<OrbObject> getItems() {
		return items;
	}

	/**
	 * @param items the items to set
	 */
	public void setItems(ArrayList<OrbObject> items) {
		this.items = items;
	}
	
	/**
	 * Adds an item
	 * @param obj
	 */
	public void addItem(OrbObject obj) {
		if(items == null) {
			items = new ArrayList<OrbObject>();
		}		
		items.add(obj);
	}

	@Override
	public int getObjectType() {
		return OrbObject.ORB_GROUP;
	}
}
